﻿<UserControl x:Class="EpiNEXT.Presentation.Enter.Pages.Home"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:view="clr-namespace:EpiNEXT.Presentation.Enter"
             xmlns:local="clr-namespace:EpiNEXT.Presentation.Enter.Pages"
             xmlns:controls="clr-namespace:EpiNEXT.Presentation.Controls;assembly=EpiNEXT.Presentation.Controls"
             xmlns:mui="http://firstfloorsoftware.com/ModernUI"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="400" d:DesignWidth="900">
    <UserControl.Style>
        <Style TargetType="{x:Type UserControl}">
            <Style.Triggers>
                <Trigger Property="Visibility" Value="Visible">
                    <Trigger.EnterActions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(UIElement.Opacity)">
                                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0" />
                                    <SplineDoubleKeyFrame KeyTime="00:00:00.300" Value="1" />
                                </DoubleAnimationUsingKeyFrames>
                                <ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty="Margin" DecelerationRatio="1" BeginTime="00:00:00" Duration="00:00:0.3">
                                    <SplineThicknessKeyFrame KeyTime="00:00:00" Value="20,0,0,0" />
                                    <SplineThicknessKeyFrame KeyTime="00:00:0.3" Value="0,0,0,0" />
                                </ThicknessAnimationUsingKeyFrames>
                            </Storyboard>
                        </BeginStoryboard>
                    </Trigger.EnterActions>
                </Trigger>
            </Style.Triggers>
        </Style>
    </UserControl.Style>
    <UserControl.DataContext>
        <local:HomeViewModel />
    </UserControl.DataContext>
    <Grid x:Name="grdMain" VerticalAlignment="Stretch">
        <Grid.RowDefinitions>
            <RowDefinition x:Name="row1" Height="24" />
            <RowDefinition x:Name="row2" Height="*" />
        </Grid.RowDefinitions>
        <StackPanel VerticalAlignment="Top">
            <!--<TextBlock Style="{StaticResource Heading1}" Margin="0, 0, 0, 10">epiNEXT project manager</TextBlock>
            <TextBlock Margin="0, 0, 0, 10">Select an existing epiNEXT project or create a new one to get started.</TextBlock>-->
            <StackPanel Grid.Row="0" Orientation="Horizontal">
                <!--<Label HorizontalAlignment="Left" Margin="0, 0, 6, 0" FontSize="16" FontWeight="Bold"  Foreground="#626262" Content="{Binding Path=ProjectsInfo.Count}" />-->
                <Label HorizontalAlignment="Left" Margin="0, 0, 20, 10" FontSize="16" FontWeight="Bold" Foreground="{StaticResource DarkTextBrush}">CURRENT PROJECTS</Label>
                <!--<ComboBox Margin="4, 2, 0, 2" SelectedIndex="0" Height="Auto" VerticalAlignment="Top">
                    <ComboBoxItem x:Name="cmbItemSummary" Content="Summary" />
                    <ComboBoxItem x:Name="cmbItemDetails" Content="Details" />
                </ComboBox>-->
            </StackPanel>

            <!--<Button x:Name="btnNewProject" MaxWidth="120" HorizontalAlignment="Left" Margin="0, 0, 0, 10" Click="btnNewProject_Click">New Project</Button>-->
            <!--<StackPanel Orientation="Horizontal">
                <TextBlock Style="{StaticResource Heading2}" Margin="0, 0, 0, 20">Existing Projects:</TextBlock>

                <TextBlock Style="{StaticResource Heading2}" Margin="10, 0, 0, 20" Text="{Binding Path=ProjectsInfo.Count}" />
            </StackPanel>-->

            <!--<StackPanel DockPanel.Dock="Top">
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                    <TextBlock Style="{StaticResource Heading2}" Foreground="#333333" Margin="0, 2, 0, 2">Existing Projects:</TextBlock>
                    
                    
                    
                </StackPanel>
            </StackPanel>-->

            <!--<StackPanel DockPanel.Dock="Top" Height="4">
            </StackPanel>-->
        </StackPanel>
        <ScrollViewer x:Name="svMain" Grid.Row="1" HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Hidden" >
            <Grid>
                <controls:ProjectsSummaryView MaxHeight="{Binding ElementName=svMain, Path=ActualHeight}" ItemsSource="{Binding ProjectsInfo}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Grid.Row="1"        
                                          Visibility="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:Home}, Mode=FindAncestor}, Path=Visibility}"
                                               MouseDown="ProjectsSummaryView_MouseDown"/>
                <!--Visibility="{Binding IsSelected, ElementName=cmbItemSummary, Converter={StaticResource ResourceKey=BooleanVisibilityValueConverter}}" MouseDown="ProjectsSummaryView_MouseDown"--> 

                <!--<controls:ProjectsDetailView MaxHeight="{Binding ElementName=svMain, Path=ActualHeight}" ItemsSource="{Binding ProjectsInfo}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Grid.Row="1"                                  
                                  Visibility="{Binding IsSelected, ElementName=cmbItemDetails, Converter={StaticResource ResourceKey=BooleanVisibilityValueConverter}}" />-->
            </Grid>
        </ScrollViewer>
    </Grid>
</UserControl>
